Skip to content

Conversation

jpienaar
Copy link
Member

Fails on windows with error

C2466: cannot allocate an array of constant size 0

else.

Fails on windows with error

C2466: cannot allocate an array of constant size 0

else.
@jpienaar jpienaar marked this pull request as ready for review July 25, 2025 08:07
@llvmbot
Copy link
Member

llvmbot commented Jul 25, 2025

@llvm/pr-subscribers-llvm-support

Author: Jacques Pienaar (jpienaar)

Changes

Fails on windows with error

C2466: cannot allocate an array of constant size 0

else.


Full diff: https://github.com/llvm/llvm-project/pull/150585.diff

1 Files Affected:

  • (modified) llvm/unittests/Support/DebugLogTest.cpp (+1-1)
diff --git a/llvm/unittests/Support/DebugLogTest.cpp b/llvm/unittests/Support/DebugLogTest.cpp
index 513699913f922..22dffd857613d 100644
--- a/llvm/unittests/Support/DebugLogTest.cpp
+++ b/llvm/unittests/Support/DebugLogTest.cpp
@@ -66,7 +66,7 @@ TEST(DebugLogTest, Basic) {
   // LDBG should be compiled out in NDEBUG, so just check it compiles and has
   // no effect.
   llvm::DebugFlag = true;
-  static const char *DT[] = {};
+  static const char *DT[] = {"A"};
   setCurrentDebugTypes(DT, 0);
   int count = 0;
   auto inc = [&]() { return ++count; };

@jpienaar jpienaar merged commit 226fb1c into llvm:main Jul 25, 2025
13 checks passed
@danilaml
Copy link
Collaborator

For reference, it also failed on GCC 13 with error: zero-size array ‘DT’

mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jul 28, 2025
Fails on windows with error

C2466: cannot allocate an array of constant size 0

else.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants